﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MUD.Lib.Objects.Users;

namespace MUD.Lib.Objects.Characters
{
    internal partial class Character : MudObject
    {
        /// <summary>
        /// How intelligent is the character? This attribute indicates how likely it is that a character
        /// will learn something new, how fast they learn and how much they can possibly learn. If I implement
        /// some sort of magic or mystical powers, this will determine how a) powerful the character is and b)
        /// how much "power" the character has to spend at any given time.
        /// </summary>
        public int Intelligence { get; set; }

        /// <summary>
        /// Wits measure the speed and agility of thought a character is capable of. How fast can the character
        /// respond intelligently to stimuli?
        /// </summary>
        public int Wits { get; set; }

        /// <summary>
        /// This is a measure of the character's conviction and determination. Can the character perform this great
        /// feat of strength or dexterity? Perhaps, if they're determined enough.
        /// </summary>
        public int Resolve { get; set; }

        /// <summary>
        /// Raw strength. This attribute determines the character's raw horsepower in melee combat,
        /// and how much they can carry, how heavy the armor they wear can be, etc.
        /// </summary>
        public int Strength { get; set; }

        /// <summary>
        /// Manual dexterity. How adept is the character at performing manual tasks, how "fast", etc.?
        /// </summary>
        public int Dexterity { get; set; }

        /// <summary>
        /// How long can the character bear under heavy physical strain? Marathon runners, SEALS etc have
        /// scores here.
        /// </summary>
        public int Stamina { get; set; }

        /// <summary>
        /// When the character walks into the room, do people take notice? This stat measures the sheer 
        /// physical charisma of the character
        /// </summary>
        public int Presence { get; set; }

        /// <summary>
        /// How easily can the character convince others to go along with him/her? Confidence artists and 
        /// successful salesmen have this in abundance.
        /// </summary>
        public int Manipulation { get; set; }

        /// <summary>
        /// When the feces hits the proverbial oscillating unit, does the character have the willpower to
        /// stand their ground and keep their cool? This measures how likely a character is to make mistakes
        /// under pressure.
        /// </summary>
        public int Composure { get; set; }

        /// <summary>
        /// Vital stats shared with inanimate objects: Health and "Willpower" (resistance to damage, mostly)
        /// </summary>
        public Vitals Vitals = new Vitals();

        public Users.User Player { get; set; }

        public string CharacterName
        {
            get { return ShortDesc; }
            set { ShortDesc = value; }
        }

        public string Bio
        {
            get { return LongDesc; }
            set { LongDesc = value; }
        }

        public Container Inventory = new Container();

        private string ShortDesc;
        private string LongDesc;

        public Character(Users.User user)
        {
            Player = user;
            Player.MasterObj.OnHeartbeat += new Master.HeartbeatHandler(DoHeartbeat);

        }

        /// <summary>
        /// Run all heartbeat-based checks.
        /// </summary>
        /// <param name="elapsed">Elapsed time in milliseconds</param>
        private void DoHeartbeat(double elapsed)
        {
            // TODO: Heartbeat-based functionality: healing, combat, 
        }



    }
}
